Skip to content

BUG: Presence of softlink in HDF5 file breaks HDFStore.keys() (GH20523) #20537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2018

Conversation

dworvos
Copy link
Contributor

@dworvos dworvos commented Mar 29, 2018

@TomAugspurger TomAugspurger added IO Data IO issues that don't fit into a more specific label IO HDF5 read_hdf, HDFStore labels Mar 29, 2018
@@ -1073,10 +1073,11 @@ def groups(self):
self._check_if_open()
return [
g for g in self._handle.walk_nodes()
if (getattr(g._v_attrs, 'pandas_type', None) or
getattr(g, 'table', None) or
if (not isinstance(g, _table_mod.link.Link) and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other cases we should exclude, or just Link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link is the abstract base class for SoftLink and ExternalLink in pytables. These subclasses do not support attributes as of HDF5 (this appears to be a limitation of the HDF5 library but may change in the future, reference: http://www.pytables.org/usersguide/libref/link_classes.html). I believe all other node types support attributes. A quick search of NoAttrs in Pytables shows usage only in tables/link.py.

@codecov
Copy link

codecov bot commented Mar 29, 2018

Codecov Report

Merging #20537 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20537      +/-   ##
==========================================
+ Coverage   91.84%   91.84%   +<.01%     
==========================================
  Files         152      152              
  Lines       49255    49255              
==========================================
+ Hits        45238    45240       +2     
+ Misses       4017     4015       -2
Flag Coverage Δ
#multiple 90.23% <ø> (ø) ⬆️
#single 41.9% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/pytables.py 92.45% <ø> (ø) ⬆️
pandas/util/testing.py 84.73% <0%> (+0.2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fac2ef1...e0a21d6. Read the comment docs.


with ensure_clean_store('tmp.__%s__.h5' % tm.rands(10)) as store:

# GH 20523
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this test right after test_keys (in the class)


def test_ignore_hdf_softlink():

with ensure_clean_store('tmp.__%s__.h5' % tm.rands(10)) as store:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the comment right below the test title

@@ -1020,6 +1020,7 @@ I/O
- Bug in :meth:`pandas.io.stata.StataReader.value_labels` raising an ``AttributeError`` when called on very old files. Now returns an empty dict (:issue:`19417`)
- Bug in :func:`read_pickle` when unpickling objects with :class:`TimedeltaIndex` or :class:`Float64Index` created with pandas prior to version 0.20 (:issue:`19939`)
- Bug in :meth:`pandas.io.json.json_normalize` where subrecords are not properly normalized if any subrecords values are NoneType (:issue:`20030`)
- Bug in :func:`HDFStore.groups` when reading a file with a softlink causes exception (:issue:`20523`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

say .keys instead here as that's more user facing.

@dworvos dworvos force-pushed the fix-softlink-hdf5 branch from 8112132 to 80033c7 Compare April 2, 2018 13:09
@dworvos dworvos force-pushed the fix-softlink-hdf5 branch from 80033c7 to e0a21d6 Compare April 2, 2018 13:52
@dworvos
Copy link
Contributor Author

dworvos commented Apr 3, 2018

Hi, had some newbie git issues yesterday with rebasing, but I think I resolved them now in my branch/fork - please let me know if there are outstanding issues.

@jreback jreback merged commit 73cb32e into pandas-dev:master Apr 3, 2018
@jreback jreback added this to the 0.23.0 milestone Apr 3, 2018
@jreback
Copy link
Contributor

jreback commented Apr 3, 2018

thanks @dworvos

@dworvos dworvos deleted the fix-softlink-hdf5 branch April 3, 2018 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Data IO issues that don't fit into a more specific label IO HDF5 read_hdf, HDFStore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Presence of softlink in HDF5 file breaks HDFStore.keys()
3 participants